package com.leyou.gateway.auth.schedu;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * User: ycs
 * Date: 2020/9/2
 * Time: 15:10
 * Description: No Description
 *
 * @author: ycs
 */
@Component
@Slf4j
public class ScheduDemo {
    Integer i=0;
    /*@Scheduled(fixedDelay = 2000)
    public void delayDemo(){
        if (i==1){
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        log.info("固定延时定时任务执行了");
        i++;
    }*/
    /*@Scheduled(fixedRate = 2000)
    public void delayDemo(){
        if (i==1){
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        log.info("频率定时任务执行了");
        i++;
    }*/
   /* @Scheduled(cron="8 5/7 9 9 * ?")
    public void cronDemo(){
        log.info("定时任务执行了");
    }*/
}
